package com.guqj.rmi;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class RmiClient {

	public static void main(String[] args) {
		
		try {
			String host = "127.0.0.1";
			int port = 1099;
			Registry registry = LocateRegistry.getRegistry(host, port);
			RmiHello stub = (RmiHello) registry.lookup("Hello");
			System.out.println("Response: " + stub.sayHello());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
